---
id: 62ff8b9dab5ac88e4d3d43a3
title: Passo 18
challengeType: 0
dashedName: step-18
---

# --description--

Seguindo as melhores práticas de acessibilidade, vincule os elementos `input` e `label` utilizando o atributo `for`.

Use `first-name`, `last-name`, `email` e `new-password` como valores para os respectivos atributos `id`.

# --hints--

O primeiro elemento `input` deve ter o `id` `first-name`.

```js
assert(document.querySelectorAll('input')?.[0]?.matches('#first-name'))
```

O segundo elemento `input` deve ter o `id` `last-name`.

```js
assert(document.querySelectorAll('input')?.[1]?.matches('#last-name'))
```

O terceiro elemento `input` deve ter o `id` `email`.

```js
assert(document.querySelectorAll('input')?.[2]?.matches('#email'))
```

O quarto elemento `input` deve ter o `id` `new-password`.

```js
assert(document.querySelectorAll('input')?.[3]?.matches('#new-password'))
```

O primeiro elemento `label` deve ter o atributo `for` com o valor `first-name`.

```js
assert(document.querySelectorAll('label')?.[0]?.matches('label[for="first-name"]'))
```

O segundo elemento `label` deve ter o atributo `for` com o valor `last-name`.

```js
assert(document.querySelectorAll('label')?.[1]?.matches('label[for="last-name"]'))
```

O terceiro elemento `label` deve ter o atributo `for` com o valor `email`.

```js
assert(document.querySelectorAll('label')?.[2]?.matches('label[for="email"]'))
```

O quarto elemento `label` deve ter o atributo `for` com o valor `new-password`.

```js
assert(document.querySelectorAll('label')?.[3]?.matches('label[for="new-password"]'))
```

# --seed--

## --seed-contents--

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Registration Form</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form method="post" action='https://register-demo.freecodecamp.org'>
--fcc-editable-region--
      <fieldset>
        <label>Enter Your First Name: <input /></label>
        <label>Enter Your Last Name: <input /></label>
        <label>Enter Your Email: <input /></label>
        <label>Create a New Password: <input /></label>
      </fieldset>
--fcc-editable-region--
      <fieldset></fieldset>
      <fieldset></fieldset>
    </form>
  </body>
</html>
```

```css
body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32;
  color: #f5f6f7;
}

label {
  display: block;
  margin: 0.5rem 0;
}

```
